<?php
namespace app\admin\model;
use think\Model;
use think\Request;

class StudentAttend extends Model { 
    protected $auto = ['admin_id'=>UID, 'remain_hours'];
    
    protected function setRemainHoursAttr()
    {
        $student_id = Request::instance()->param('student_id');
        $course_id= Request::instance()->param('course_id');
        $where['student_id'] = $student_id;
        $where['course_id'] = $course_id;
        //学生选课信息
        $studentCourse = StudentCourse::get($where);
        return $studentCourse['remain_hours'];
    }
}